package cmsc427.mw5.app;


import cmsc427.mw5.*;


public class Contact {
    
	private int id;
	private String name;
	private boolean selected;
	
	public Contact(int id, String name){
		this.id = id;
		this.name = name;
		this.selected = false;
	}
	
	@Override
	public boolean equals(Object o){
		
		if(o.getClass().equals(this.getClass())){
			Contact other = (Contact) o;
			return getID() == other.getID();
		}
		
		return false;
	}
	
	public String getName(){
		return this.name;
	}
	
	public int getID(){
		return this.id;
	}
	
	public int getImage(){
		// TODO just returns default icon
		return R.drawable.android_icon_32;
	}
	
	public String getPrimaryPhone(){
		// TODO just returns a default value
		return "4436902666";
	}
	
	public boolean isSelected(){
		return this.selected;
	}
	
	public void setSelected(boolean selected){
		this.selected = selected;
	}
	
	public boolean toggleSelected(){
		setSelected(!isSelected());
		return isSelected();
	}
	
	@Override
	public String toString(){
		return getName();
	}
}
